package com.yupi.springbootinit.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.springbootinit.model.dto.course.CourseQueryRequest;
import com.yupi.springbootinit.model.entity.Course;
import com.yupi.springbootinit.model.entity.User;
import com.yupi.springbootinit.model.vo.CourseVO;

import javax.servlet.http.HttpServletRequest;

public interface CourseService extends IService<Course> {
    /**
     * 获取课程列表
     */
    Page<Course> listCourses(CourseQueryRequest request);
    
    /**
     * 获取课程详情
     */
    CourseVO getCourseById(long id, HttpServletRequest request);
    
    /**
     * 收藏/取消收藏课程
     */
    int favoriteCourse(long courseId, User loginUser);
    
    /**
     * 报名课程
     */
    boolean enrollCourse(long courseId, User loginUser);
} 